<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/multiselect.css" />
<link rel="stylesheet" href="${aier_css_url}jc/chosen.css">
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet" href="${aier_css_url}social/school/common.css" />
<link rel="stylesheet" href="${aier_css_url}social/school/smanage.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}${aier_jqui_js}ui.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/ja.js"></script>
<script type="text/javascript" src="${aier_js_url}jc/cj.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/multiselect.js"></script>
<script type="text/javascript" src="${aier_js_url}social/school/attend/teahol.js"></script>

</head>
<script type="text/javascript">
	var global_suffix = "${aier_suffix}", global_url = "${aier_url}", global_uri = "${aier_uri}", global_urijs = "${aier_urijs}", 
		global_sid = "${sid}", global_tid = "${tid}";
</script>
<!-- 教师 假期查询-->
<body>


	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user"
		executeResult="true"></s:action>

	<!-- 正文 -->
	<div id="hfContent" class="ar-content">
		<div class="content-main">
			<!-- 学校名称栏 -->
			<s:action name="scomm_schoolMTitle" namespace="/school"
				executeResult="true"></s:action>
			<div class="main-content wrap-bg clearfix">
				<!-- 左侧栏 -->
				<s:action name="scomm_teacherMLeft" namespace="/school"
					executeResult="true"></s:action>
				<!-- 右侧内容 -->
				<div class="ae-right">
					<div class="right-main">
						<div class="right-main-top">
							<div class="binfo-title">
								<h3>假期管理</h3>
							</div>
							<div class="right-line"></div>
						</div>
						<div class="right-main-c">
							<div class="info-tab01">
								<table id="inviteParTable">
									<tbody>
										<tr>
											<th class="gray6">起始时间：</th>
											<td><input id="start_txt" class="PY-input" type="text"
												onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy-MM-dd',readOnly:true})">

											</td>
											<th class="gray6">结束时间：</th>
											<td><input id="end_txt" type="text" class="PY-input"
												onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy-MM-dd',readOnly:true})">
											</td>
											<td style="width:150px;" align="right"><a id="b_hmsel"
												onclick="search_hol()" href="javascript:;"
												class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only fr"
												role="button" aria-disabled="false"><span
													class="ui-button-text">查询</span> </a></td>
										</tr>

									</tbody>

								</table>
							</div>
							<div class="right-main-down">
								<div class="down-line"></div>

								<div class="down-inre">
									<table id="holidayinfo"></table>
									<div id="holidaypage"></div>
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>

		</div>
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>

</body>
<script type="text/javascript">
	$("#tabs").tabs();

	function search(){
		var sid = "${sid }";
		var txt_sdate = $('#start_txt').val();
		var txt_edate = $('#end_txt').val();
		jQuery("#holidayinfo").jqGrid('setGridParam',{url:"${aier_url}${aier_urijs}schoolhol_search${aier_suffix}?sid="+sid
			+"&txt_sdate="+txt_sdate+"&txt_edate="+txt_edate,page:1}).trigger("reloadGrid");
	}
	
$('#txt_upend').focus(function() {
$("#d_hdays").css("visibility", "hidden");
});
$("#txt_upend").blur(function (){
	var sadate = $('#txt_upstart').val();
	var eadate = $('#txt_upend').val();
	if(sadate!=""&&eadate!=""&&sadate<=eadate){
		$("#span_hdays").html(daysBetween(sadate,eadate));
		$("#d_hdays").css("visibility", "visible");	
	}
	
});

//| 求两个时间的天数差 日期格式为 YYYY-MM-dd   
function daysBetween(DateOne,DateTwo) 
{  
    var OneMonth = DateOne.substring(5,DateOne.lastIndexOf ('-')); 
    var OneDay = DateOne.substring(DateOne.length,DateOne.lastIndexOf ('-')+1); 
    var OneYear = DateOne.substring(0,DateOne.indexOf ('-')); 
    
    var TwoMonth = DateTwo.substring(5,DateTwo.lastIndexOf ('-')); 
    var TwoDay = DateTwo.substring(DateTwo.length,DateTwo.lastIndexOf ('-')+1); 
    var TwoYear = DateTwo.substring(0,DateTwo.indexOf ('-')); 
    
    var cha=((Date.parse(OneMonth+'/'+OneDay+'/'+OneYear)- Date.parse(TwoMonth+'/'+TwoDay+'/'+TwoYear))/86400000);   
    return Math.abs(cha)+1; 
}


</script>
</html>